package com.wy.td.test;

import com.wy.td.entity.DefaultTestTable;
import com.wy.td.entity.IotReceiptUploadDataEntity;
import com.wy.td.utils.TDengineUtil;

import java.util.Date;
import java.util.List;

/**
 * @author: 火蚁
 * @date: 2020/6/17
 * @version: 1.0
 * @desc:
 */
public class MyMain {
    public static void main(String[] args) throws Exception{
        TDengineUtil util = new TDengineUtil("jdbc:TAOS://192.168.0.126:6020/db","root","taosdata",true);

//        util.insert("t",new IotReceiptUploadDataEntity(new Date(),null,"33.3",true,"12","1234",12,"22.3","30","14",new Date()));
//        util.insertWithStable("a1_001","netuo_device",
//                new IotReceiptUploadDataEntity(new Date(),null,"33.3",true,"12","1234",12,"22.3","30","14",new Date()),"样子将中路","ce","1");
//
//
//        List<IotReceiptUploadDataEntity> list = util.getList("select * from  v1_001",IotReceiptUploadDataEntity.class);
//        System.out.println(list);

        util.insert("t",new DefaultTestTable(new Date(),101));
//        util.insertWithStable()

        List<DefaultTestTable> list = util.getList("select * from t",DefaultTestTable.class);
        for (DefaultTestTable item: list) {
            System.out.println(item.getTs()+"---"+item.getSpeed());
        }
    }
}
